package com.bawei.newsapplication.model.api
import ConsumerDetailsBean
import LunBean
import ProductDetailBean
import com.bawei.coom.model.bean.aomm.AddShippingBean

import com.bawei.coom.model.bean.domm.DaleteBean
import com.bawei.coom.model.bean.fomm.FrontPageListBean
import com.bawei.coom.model.bean.gomm.GoldBalanceBean
import com.bawei.coom.model.bean.homm.LoginBean
import com.bawei.coom.model.bean.momo.ModifyNickNameBean
import com.bawei.coom.model.bean.momo.MyColumnListBean
import com.bawei.coom.model.bean.momo.MyInfoBean
import com.bawei.coom.model.bean.momo.MyTaskListBean
import com.bawei.coom.model.bean.fomm.NotBean
import com.bawei.coom.model.bean.gomm.PageSearchBean
import com.bawei.coom.model.bean.gomm.ProductListBean
import com.bawei.coom.model.bean.gomm.RegisterBean
import com.bawei.coom.model.bean.domm.ShippingAddressLBean
import com.bawei.coom.model.bean.domm.ShootListBean
import com.bawei.coom.model.bean.domm.SignRecordBean
import com.bawei.coom.model.bean.domm.TypeListBean
import com.bawei.coom.model.bean.domm.UserSignBean
import com.bawei.coom.model.bean.domm.VideoListBean
import com.bawei.coom.model.bean.bomm.BannerBean
import com.bawei.coom.model.bean.bomm.BrowsingHistBean
import com.bawei.coom.model.bean.comm.AstatusBean
import com.bawei.coom.model.bean.comm.AuthorsShootListBean
import com.bawei.coom.model.bean.comm.ColumnBean
import com.bawei.coom.model.bean.comm.ColunbListBean
import com.bawei.coom.model.bean.comm.PublishShootBean
import com.bawei.coom.model.bean.comm.ShootDetailBean
import com.bawei.coom.model.bean.comm.SyncMyColumnBean
import com.bawei.coom.model.bean.fomm.AnswerCommentListBean
import com.bawei.coom.model.bean.fomm.AnswerListBean
import com.bawei.coom.model.bean.fomm.NewsListBean
import com.bawei.coom.model.bean.fomm.QuestionBean
import com.bawei.coom.model.bean.gomm.PublishBean
import com.bawei.coom.model.bean.homm.ProblemListBean
import com.bawei.coom.model.bean.wangjiayun.LikeBean
import com.bawei.coom.model.bean.wangjiayun.NewsDetailCommentBean
import com.bawei.coom.model.bean.wangjiayun.PraiseNewsBean
import com.bawei.coom.model.bean.wangjiayun.PublishCommentBean

import io.reactivex.Observable
import okhttp3.MultipartBody
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Part
import retrofit2.http.Query
/**
 * @author : 谢庆平
 * @date   : 2024/10/15 20:41
 * @desc   :接口文档Api
 */
interface ApiServer {
    //TODO 发布商品
    @POST("hotNews/mall/v1/publishProduct")
    fun getPublish(@Header("userId") userId: String, @Body map: HashMap<String, Any>): Observable<PublishBean>

    //TODO 查询浏览记录历史
    @GET("hotNews/user/verify/v1/findBrowsingHistory")
    fun getBrowsingHistory(@Header("userId") userId:String,@Header("token") token:String,
                   @Query("page") page:Int,@Query("size") size:Int):Observable<BrowsingHistBean>
    //TODO 查询新闻的详情列表数据
    @GET("hotNews/news/v1/findNewsCommentList")
    fun getNewsDetailComment(@Header("userId") userId:String,@Header("token") token:String,@Query("newsId") newsId:Int,
                             @Query("page") page:Int,@Query("size") size:Int):Observable<NewsDetailCommentBean>
    @PUT("hotNews/news/verify/v1/praiseNewsComment")
    fun getLike(@Header("userId") userId:String,
                @Header("token") token:String,@Query("commentId") commentId:Int):Observable<LikeBean>


    @GET("hotNews/news/v1/findNewsDetail")
    fun getNewsDetail(@Header("userId") userId:String,@Header("token")
    token:String,@Query("newsId") newsId:Int):Observable<com.bawei.coom.model.bean.wangjiayun.NewsDetailBean>


    @PUT("hotNews/news/verify/v1/praiseNews")
    fun getPraiseNews(@Header("userId") userId:String,@Header("token") token:String,
                      @Query("newsId") newsId:Int):Observable<PraiseNewsBean>

    @POST("hotNews/news/verify/v1/publishComment")
    fun getPublishComment(@Header("userId") userId:String,@Header("token") token:String,
                          @Body map: HashMap<String, String>):Observable<PublishCommentBean>

//TODO 微信登录网络接口
//    @POST("hotNews/user/v1/weChatLogin")
//    fun getWxLogin(@Query("code")code:Int):Observable<LunBean>

    //TODO 置顶数据
    @GET("hotNews/news/v1/findColumnNewsList")
    fun getNewsList(@Query("columnId")columnId:Int
                    ,@Query("page")page:Int
                    ,@Query("size") size:Int):Observable<NewsListBean>
    //TODO 轮播图
    @GET("hotNews/news/v1/findBannerList")
    fun getBanner():Observable<BannerBean>
    //TODO 查询视频频道列表
    @GET("hotNews/video/v1/findColumnList")
    fun getColumnList():Observable<ColunbListBean>
    //TODO 获取热点视频
    @GET("hotNews/news/v1/findColumnList")
    fun getMyColumnList(@Header("userId")userId:String
                        ,@Header("token")token:String):Observable<MyColumnListBean>
    //TODO 查询首页信息
    @GET("hotNews/news/v1/findFrontPageList")
    fun getFrontPageList(@Header("userId")userId:String,@Query("page")page:Int
    ,@Query("size") size:Int):Observable<FrontPageListBean>

    //TODO 登录
    @POST("hotNews/user/v1/login")
    fun  getLogin(@Body map:HashMap<String,String>):Observable<LoginBean>
    //TODO 注册
    @POST("hotNews/user/v1/register")
    fun getRegister(@Header("userName")userName:String,
                    @Header("nickName")nickName:String,
                    @Header("passwd") passwd:Int):Observable<RegisterBean>
    //TODO 查询我的信息
    @GET("hotNews/user/verify/v1/findMyInfo")
    fun getMyInfo(@Header("userId") userId:String
                  ,@Header("token") token:String):Observable<MyInfoBean>
//TODO 修改昵称
    @PUT("hotNews/user/verify/v1/modifyNickName")
    fun getModifyNickName(@Header("userId")userId:String,
                          @Header("token")token:String
                          ,@Body map: HashMap<String, String>):Observable<ModifyNickNameBean>

    //TODO 消息列表
    @GET("hotNews/user/verify/v1/findNotice")
    fun getnot(@Header("userId") userId:String,
                   @Header("token") token:String,
                   @Query("noticeType") noticeType:Int,
                   @Query("page")page:Int,
                   @Query("size")siz:Int):Observable<NotBean>
    //TODO 回答列表数据

    @GET("hotNews/problem/v1/findAnswerList")
    fun getAnswerList(@Query("problemId")problemId:Int,
                      @Query("page")page:Int
                      ,@Query("size")size:Int):Observable<AnswerListBean>

    @GET("hotNews/problem/v1/findProblemList")
    fun getProblemList(@Query("page")page:Int,
                       @Query("size")siz:Int):Observable<ProblemListBean>
    //TODO 查询问题的回答列表
    @GET("hotNews/problem/v1/findAnswerCommentList")
    fun getAnswerCommentList(@Query("answerId") answerId:Int,
                        @Query("page") page:Int,
                        @Query("size") size:Int):Observable<AnswerCommentListBean>
    //TODO 查询问题的评论列表
    @GET("hotNews/problem/v1/search")
    fun getSearch(@Query("keyword")keyword:String,@Query("page")page:Int,
                  @Query("size")siz:Int):Observable<ShootListBean>

    //TODO 发布提问
    @Multipart
    @POST("hotNews/problem/verify/v1/publishQuestion")
    fun getQuestion(@Header("userId") userId:String,
                    @Header("token") token:String,
                    @Query("content") content:String,
                    @Part media: String
    ):Observable<QuestionBean>


    //TODO 视频列表
    @GET("hotNews/video/v1/findVideoList")
    fun getVideoList(@Header("userId") userId:String,
                     @Header("token") token:String,
                     @Query("columnId")columnId:Int,
                     @Query("page") page:Int,
                     @Query("size") size:Int):Observable<VideoListBean>
    //TODO 我的任务列表
    @GET("hotNews/user/verify/v1/findMyTaskList")
    fun getMyTaskList(@Header("userId") userId:String,
                      @Header("token") token:String):Observable<MyTaskListBean>
    //TODO 我的签到进度条
    @GET("hotNews/user/verify/v1/findMySignRecord")
    fun getSignProgress(@Header("userId") userId:String,
                         @Header("token") token:String):Observable<SignRecordBean>
    //TODO 签到
    @GET("hotNews/user/verify/v1/userSign")
    fun getUserSign(@Header("userId") userId:String,
                    @Header("token") token:String):Observable<UserSignBean>
    //TODO 金币商城
    @GET("hotNews/user/verify/v1/findMyGoldBalance")
    fun getGoldBalance(@Header("userId") userId:String,
                   @Header("token") token:String):Observable<GoldBalanceBean>
    //TODO 金币商城
    @GET("hotNews/mall/v1/findProductList")
    fun getProductList( @Query("page") page:Int,
                        @Query("size") size:Int):Observable<ProductListBean>
    //TODO 商品商城详情
    @GET("hotNews/mall/v1/findProductDetail")
    fun getProductDetail(@Query("productId")productId:Int):Observable<ProductDetailBean>

    //TODO 我的收货地址列表
    @GET("hotNews/user/verify/v1/findMyShippingAddressList")
    fun getShippingAddressList(@Header("userId") userId:String,
                       @Header("token") token:String):Observable<ShippingAddressLBean>
    //TODO 添加收货地址
    @POST("hotNews/user/verify/v1/addShippingAddress")
    fun getAddShipping(@Header("userId") userId:String,
                       @Header("token") token:String
                       ,@Body map:HashMap<String,String>):Observable<AddShippingBean>
    //TODO 删除收货地址
    @DELETE("hotNews/user/verify/v1/deleteAddress")
    fun getDeleteAddress(@Header("userId") userId:String,
                        @Header("token") token:String
                        ,@Query("addressId") addressId:Int):Observable<DaleteBean>
    //    修改收货地址
//    hotNews/user/verify/v1/modifyShippingAddress
    @PUT("hotNews/user/verify/v1/modifyShippingAddress")
    fun getModifyShipping(
        @Header("userId") userid: String,
        @Header("token") token: String,
        @Body map: Map<String, String>
    ): Observable<LunBean>
    //TODO 获取首页搜索框数据
    @GET("hotNews/news/v1/homePageSearch")
    fun getPageSearch(@Query("keyword") keyword:String,
                      @Query("page")page:Int,
                      @Query("size")siz:Int):Observable<PageSearchBean>
    //TODO 获取全名拍作者详情
    @GET("hotNews/shoot/v1/findAuthorsShootList")
    fun getAuthorShootList(@Query("authorId") authorId:Int,
                           @Query("page") page:Int,
                           @Query("size")size:Int):Observable<AuthorsShootListBean>

    //TODO 获取全名拍分类数据数据
    @GET("hotNews/shoot/v1/findTypeList")
    fun getTypeList():Observable<TypeListBean>

    //TODO 获取全名拍列表数据数据
    @GET("hotNews/shoot/v1/findShootList")
     fun getShootList(@Query("typeId") typeId:Int,
                    @Query("page") page:Int,
                    @Query("size") size:Int):Observable<ShootListBean>
     //TODO 获取全名拍详情数据
     @GET("hotNews/shoot/v1/findShootDetail")
     fun getShootDetail(@Header("userId") userId:String,
                        @Header("token") token:String,
                        @Query("shootId") shootId:Int):Observable<ShootDetailBean>
     //TODO 获取全名拍评论数据
     @GET("hotNews/shoot/v1/findShootCommentList")
     fun getPublish(@Header("userId") userId:String,
                    @Header("token") token:String,
                    @Body map:HashMap<String,String>):Observable<PublishBean>
     //TODO 获取评论数据内容
     @GET("hotNews/shoot/v1/findShootCommentList")
     fun getCommentList(@Header("userId") userId:String,
                    @Header("token") token:String,
                    @Query("shootId") shootId:Int,
                        @Query("page")page:Int,
                        @Query("size")size:Int):Observable<AstatusBean>
//TODO 获取发布数据内容
     @Multipart
     @POST("hotNews/shoot/verify/v1/publishShoot")
     fun getPublishShoot(@Header("userId") userId:String,
                    @Header("token") token:String,
                         @Query("typeId")typeId:Int,
                         @Query("title")title:String,
                         @Query("content") content:String,
                         @Query("longitude")longitude:String,
                         @Query("latitude")latitude:String,
                         @Query("anonymityFlag") anonymityFlag:Int,
                         @Query("mediaType")mediaType:Int,
                         @Part media:List<MultipartBody.Part>):Observable<PublishShootBean>




    //查询我的签到条
    @GET("/hotNews/user/verify/v1/findMySignRecord")
    fun getSignRecord(
        @Header("userId") userid: String,
        @Header("token") token: String
    ): Observable<SignRecordBean>

    //    查询我的金币消费明细
    @GET("hotNews/user/verify/v1/findMyGoldConsumerDetails")
    fun getGold(
        @Header("userId") userid: String,
        @Header("token") token: String,
        @Query("type") type: Int,
    ): Observable<ConsumerDetailsBean>
    //TODO  查询频道管理列表
    @GET("hotNews/news/v1/findColumnList")
    fun getColumn(@Header("userId") userId:String,
                  @Header("token") token:String):Observable<ColumnBean>

    //TODO 同步更新频道管理列表
    @PUT("hotNews/news/verify/v1/syncMyColumn")
    fun getSyncMyColumn(@Header("userId") userId:String,
                        @Header("token") token:String,
                        @Query("myColumns") columnId:String):Observable<SyncMyColumnBean>
}
